package com.itqf.yun.controller;

import com.itqf.yun.dto.BillDto;
import com.itqf.yun.pojo.Bill;
import com.itqf.yun.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.crypto.spec.PSource;

/**
 * projectName: last
 *
 * @author: Ayangcx
 * time: 2021/9/28 22:49
 * description:
 */
@RestController
@CrossOrigin("*")
@RequestMapping("bill")
public class BillController {
	@Autowired
	private BillService billService;

	@GetMapping("billSearch")
	public Object billSearch (BillDto billDto) {
		Object o = billService.billSearch(billDto.getBstate());
		return o;
	}

	@GetMapping("blist")
	public Object blist (BillDto billDto) {
		Object o = billService.blist(billDto);
		return o;
	}

	@GetMapping("delete")
	public Object delete (int bid) {
		Object o = billService.delete(bid);
		return o;
	}

	@PostMapping("update")
	public Object update (@RequestBody Bill bill) {
		Object o = billService.update(bill);
		return o;
	}
}
